import 'package:flutter/material.dart';
import 'package:lib_core/lib_core.dart';

import '../routes/common_routes.dart';

extension BoostExt on BoostNavigator {
  Future<Object?> bottomSheet(
    Widget bottomsheet, {
    Color? backgroundColor,
    double? elevation,
    bool persistent = true,
    ShapeBorder? shape,
    Clip? clipBehavior,
    Color? barrierColor,
    bool? ignoreSafeArea,
    bool? removeBottom,
    bool isScrollControlled = false,
    bool useRootNavigator = false,
    bool isDismissible = true,
    bool enableDrag = true,
    bool opaque = true,
    bool withContainer = false,
    RouteSettings? settings,
    Duration? enterBottomSheetDuration,
    Duration? exitBottomSheetDuration,
  }) {
    return BoostNavigator.instance.push(
      CommonRoutes.bottomSheet,
      arguments: {
        'bottomsheet': bottomsheet,
        'backgroundColor': backgroundColor,
        'elevation': elevation,
        'persistent': persistent,
        'shape': shape,
        'clipBehavior': clipBehavior,
        'barrierColor': barrierColor,
        'ignoreSafeArea': ignoreSafeArea,
        'removeBottom': removeBottom,
        'isScrollControlled': isScrollControlled,
        'useRootNavigator': useRootNavigator,
        'isDismissible': isDismissible,
        'enableDrag': enableDrag,
        'settings': settings,
        'enterBottomSheetDuration': enterBottomSheetDuration,
        'exitBottomSheetDuration': exitBottomSheetDuration
      },
      opaque: opaque,
      withContainer: withContainer,
    );
  }

  Future<Object?> dialog(
    Widget widget, {
    bool barrierDismissible = true,
    Color? barrierColor,
    bool useSafeArea = true,
    bool withContainer = false,
    Duration? transitionDuration,
    Curve? transitionCurve,
    RouteSettings? routeSettings,
  }) {
    return BoostNavigator.instance.push(
      CommonRoutes.dialog,
      arguments: {
        'widget': widget,
        'barrierDismissible': barrierDismissible,
        'barrierColor': barrierColor,
        'useSafeArea': useSafeArea,
        'transitionDuration': transitionDuration,
        'transitionCurve': transitionCurve,
        'routeSettings': routeSettings,
      },
      withContainer: withContainer,
    );
  }
}
